package com.qihoo.finance.backup;

import com.qihoo.finance.backup.reader.StreamBackReader;
import com.qihoo.finance.backup.writer.BackWriter;

/**
 * 流式备份器
 */
public class StreamBacker extends Backer {

    private final StreamBackReader backReader;

    private final BackWriter backWriter;

    public StreamBacker(StreamBackReader backReader, BackWriter backWriter) {
        this.backReader = backReader;
        this.backWriter = backWriter;
    }

    public StreamBackReader getBackReader() {
        return backReader;
    }

    public BackWriter getBackWriter() {
        return backWriter;
    }

    @Override
    Result backup() throws Exception {
        return backReader.invoke(this);
    }
}
